﻿namespace Shapes
{
    using System;
    using System.Collections.Generic;
    using System.Drawing;
    using Shapes.MyShapes;

    class Program
    {
        static string key;

        static void Main(string[] args)
        {
            Shape s;
            List<Shape> list = new List<Shape>();

            Console.WriteLine("Graphic.");
            Console.WriteLine("Menu: ");
            Console.WriteLine("| e | - Exit");
            Console.WriteLine("| r | - Rectangle visualization");
            Console.WriteLine("| t | - Triangle visualization");
            Console.WriteLine("| l | - Show list of shapes");
            do
            {
                key = Console.ReadLine();
                switch (key)
                {
                    case "r":
                        {
                            s = new RectAngle(3, 8,true, new Point(2, 5));
                            list.Add(s);
                            s.Draw();
                            break;
                        }
                    case "t":
                        {
                            s = new TriAngle(3, 3, true, new Point(5, 2));
                            list.Add(s);
                            s.Draw();
                            break;
                        }
                    case "l":
                        {
                            list.Add(new RectAngle(4, 4, false, new Point(10, 3)));
                            list.Add(new RectAngle(2, 10, true, new Point(2, 6)));
                            list.Add(new TriAngle(3, 3, true, new Point(5, 2)));
                            list.Add(new TriAngle(7, 7, false, new Point(20, 5)));

                            foreach (var item in list)
                            {
                                item.Draw();
                            }
                            break;
                        }
                    default:
                        {
                            break;
                        }
                }

            } while (!key.Equals('e'));
        }
    }
}
